/*
自己选择的路 ,跪着也要走完。朋友们 , 虽然这个世界日益浮躁起来,只
要能够为了当时纯粹的梦想和感动坚持努力下去 , 不管其它人怎么样,我
们也能够保持自己的本色走下去。
To the world , you will be a person , but to a person , you
will be the world .                               ——AKPower
*/
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string>
#include <stack>
#include <set>
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;
ll n;
string s1, s2;
bool vis[30][30];
pair<char, char> ans[1000];
ll fa[30];

ll find(ll x)
{
    if (x == fa[x])
    {
        return x;
    }
    return fa[x] = find(fa[x]);
}
vector<ll> ans_id;
int main()
{
    IOS;
    cin >> n;
    cin >> s1 >> s2;
    ll id = 0;
    for (ll i = 0; i < 26; i++)
    {
        fa[i] = i;
    }
    for (ll i = 0; i < n; i++)
    {
        if (s1[i] == s2[i])
            continue;
        if (vis[s1[i] - 'a'][s2[i] - 'a'])
            continue;
        vis[s1[i] - 'a'][s2[i] - 'a'] = true;
        vis[s2[i] - 'a'][s1[i] - 'a'] = true;
        ans[id].first = s1[i];
        ans[id].second = s2[i];
        id++;
    }
    ll cnt = 0;
    for (ll i = 0; i < id; i++)
    {
        ll tx = ans[i].first - 'a';
        ll ty = ans[i].second - 'a';
        ll fx = find(tx);
        ll fy = find(ty);
        if (fx == fy)
            continue;
        fa[max(fx, fy)] = min(fx, fy);
        ans_id.push_back(i);
        cnt++;
        if (cnt == 25)
            break;
    }
    cout << cnt << endl;
    for (ll i = 0; i < cnt; i++)
    {
        cout << ans[ans_id[i]].first << " " << ans[ans_id[i]].second << endl;
    }
    getchar();
    getchar();
    return 0;
}
